import React from "react";
export default class Ref extends React.Component{
    constructor(){
        super();
        this.helloDiv = React.createRef();
    }
    componentDidMount(){
        this.helloDiv.current.style.color="red";
    }
    render(){
        return(
            <div>
                dhgf
                <div ref={this.helloDiv}>
                    hello
                </div>
            </div>
        )
    }
}